The two statements should start out the program.
Here is the modified program:
' Complete program ' PRINT "How many times do you want to print Hello" INPUT ENDVALUE LET COUNT = 1 DO WHILE COUNT <= ENDVALUE PRINT "Hello" LET COUNT = COUNT + 1 LOOP END
In this program, statements handle three tasks:
It might look like this is a lot of work. But if the user types in 1000, "Hello" is printed 1000 times. (Remember the power of cycles.) This is much better than typing the statement 1000 times.
Say that the user runs the program and enters a 0:
How many times do you want to print Hello ? 0
How many "Hellos" will appear on the monitor screen?